<div class="header_item_box bg_gray">
    <div class="top_header big_block">
        <div class="contact_way">
            <div class="contact_email">
                <img style="width: 18px;height: 18px" src="/static/images/icons/email.svg" alt="email">
                <span><a href="/contact#inquiry_area" title="Send us an email">marketing@eschemy.com</a></span>
            </div>
            <div class="contact_phone">
                <img style="width: 18px;height: 18px" src="/static/images/icons/phone.svg" alt="phone">
                <span><a href="tel:+86-24-31029932" title="Call us">+86-24-31029932</a></span>
            </div>
        </div>
        <!-- 添加社交媒体链接 -->
        <div class="social_links">
            <a href="#" title="Follow us on LinkedIn" target="_blank" rel="noopener">
                <img src="/static/images/icons/linkedin.svg" alt="LinkedIn" width="18" height="18">
            </a>
            <a href="#" title="Follow us on Twitter" target="_blank" rel="noopener">
                <img src="/static/images/icons/twitter.svg" alt="Twitter" width="18" height="18">
            </a>
        </div>
    </div>
</div>
<div class="header_item_box">
    <div class="search_block big_block flex">
        <div class="logo fixed-logo-p-r">
            <a href="/" title="${(site?filter(item -> item.configKey == 'site_name')[0].configValue)!''}">
                <img class="contain" 
                     src="${(site?filter(item -> item.configKey == 'site_logo')[0].configValue)!''}" 
                     alt="${(site?filter(item -> item.configKey == 'site_name')[0].configValue)!''}" 
                     width="150" 
                     height="50">
            </a>
        </div>
        <div class="header_item_box">
            <!-- PC端菜单 -->
            <ul class="nav_box big_block">
                <#list category as menuItem>
                    <#if menuItem.parentId == 0>
                        <#assign currentUrl = (request.requestUri)!'/'>
                        <#-- 检查是否有子菜单 -->
                        <#assign hasChildren = false>
                        <#list category as subCat>
                            <#if subCat.parentId == menuItem.id>
                                <#assign hasChildren = true>
                                <#break>
                            </#if>
                        </#list>
                        
                        <#-- 根据是否有子菜单决定路径格式 -->
                        <#assign itemPath = '/' + (menuItem.path)!?remove_beginning('/')>
                        <#if hasChildren>
                            <#assign itemPath = itemPath?remove_ending('/')>
                        </#if>
                        <#assign isActive = currentUrl?starts_with(itemPath)>
                        
                        <li class="${isActive?string('active', '')}">
                            <a href="${itemPath}" title="${menuItem.title!}">
                                ${menuItem.title!}
                                <#if hasChildren>
                                    <svg class="icon" viewBox="0 0 1024 1024" version="1.1" aria-hidden="true">
                                        <path d="M511.998465 620.776426 729.55234 403.222551 294.446637 403.222551Z"></path>
                                    </svg>
                                </#if>
                            </a>
                            <#if hasChildren>
                                <ul class="submenu">
                                    <#list category as subCategory>
                                        <#if subCategory.parentId == menuItem.id && subCategory.isShow == "2">
                                            <#assign subPath = itemPath + '/' + (subCategory.path)!?remove_beginning('/')>
                                            <#assign isSubActive = currentUrl?starts_with(subPath)>
                                            <li class="${isSubActive?string('active', '')}">
                                                <a href="${subPath}" title="${subCategory.title!}">
                                                    ${subCategory.title!}
                                                </a>
                                            </li>
                                        </#if>
                                    </#list>
                                </ul>
                            </#if>
                        </li>
                    </#if>
                </#list>
            </ul>

            <!-- 移动端菜单 -->
            <div class="mobile_menu_trigger" role="button" tabindex="0">
                <span></span>
                <span></span>
                <span></span>
            </div>
            <ul class="nav_box_min big_block">
                <#list category as menuItem>
                    <#if menuItem.parentId == 0>
                        <#assign currentUrl = (request.requestUri)!'/'>
                        <#-- 检查是否有子菜单 -->
                        <#assign hasChildren = false>
                        <#list category as subCat>
                            <#if subCat.parentId == menuItem.id>
                                <#assign hasChildren = true>
                                <#break>
                            </#if>
                        </#list>
                        <#-- 根据是否有子菜单决定路径格式 -->
                        <#assign itemPath = '/' + (menuItem.path)!?remove_beginning('/')>
                        <#if hasChildren>
                            <#assign itemPath = itemPath?remove_ending('/')>
                        </#if>
                        <#assign isActive = currentUrl?starts_with(itemPath)>
                        <li [class]="nav_s_op${menuItem_index}?'opens subordinate${isActive?string(' active', '')}':'subordinate${isActive?string(' active', '')}'}"
                            role="button"
                            tabindex="op_li${menuItem_index}"
                            on="tap:AMP.setState({nav_s_op${menuItem_index}:!nav_s_op${menuItem_index}})">
                            <a href="${itemPath}" title="${menuItem.title!}">${menuItem.title!}</a>
                            <#if hasChildren>
                                <ul class="mobile_submenu">
                                    <#list category as subCategory>
                                        <#if subCategory.parentId == menuItem.id && subCategory.isShow == "2">
                                            <#assign subPath = itemPath + (subCategory.path)!?remove_beginning('/')>
                                            <#assign isSubActive = currentUrl?starts_with(subPath)>
                                            <li class="${isSubActive?string('active', '')}">
                                                <a href="${subPath}" title="${subCategory.title!}">
                                                    ${subCategory.title!}
                                                </a>
                                            </li>
                                        </#if>
                                    </#list>
                                </ul>
                            </#if>
                        </li>
                    </#if>
                </#list>
            </ul>
        </div>
    </div>
</div>
